package com.lilihub.miaosha.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.constraints.NotNull;
import java.lang.annotation.*;

/**
 * @BelongsProject: miaosha2
 * @BelongsPackage: com.lilihub.miaosha.validator
 * @Author: LiYing
 * @CreateTime: 2021-04-26 10:44
 * @Description:
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(
        validatedBy = {isPhoneValidator.class}
)
public @interface isPhone {

    boolean required() default false;

    String message() default "手机号码有误";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}